package com.dailyblue.java.cloud.bookstroe.book.controller;

import com.dailyblue.cloud.bookstore.commons.util.JsonResult;
import com.dailyblue.java.cloud.bookstroe.book.service.BookService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/book")
public class BooksController {
    @Resource
    private BookService bookService;

    @GetMapping
    public JsonResult find() {
        return bookService.findAllBooks();
    }
}
